<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>css动画原理</title>
  <script src="../../static/vue.js"></script>
  <style>
    .fade-enter,
    .fade-leave-to{
      opacity: 0;
    }
    .fade-enter-active,
    .fade-leave-active{
      transition: opacity 3s;
    }


  </style>
</head>
<body>
<div id="root">
  <transition name="fade">
    <!--<div v-if="show"> hellw world</div>-->
    <div v-show="show"> hellw world</div>
  </transition>

  <button @click="handleClick">按钮</button>
</div>
<script>
  var vm = new Vue({
    el: '#root',
    data: {
      show: true
    },
    methods: {
      handleClick: function () {
        this.show = !this.show
      }
    }
  })

</script>
</body>
</html>
